<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>attr</title>
	<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function () {
			$("button").click(function () {
				alert($("#w3s").attr("href"))

			})

		})

	</script>
</head>
<body>
<p><a href="http://www.w3school.com.cn" id="w3s">W3School.com.cn</a></p>
<button>显示href值</button>

</body>
</html>